{{--前台详情页--}}
@extends('default.layouts.part_time_managePublic')
@section('title', '兼职报名管理')
{{--兼职详情页css--}}
@section('headcss')
    <meta name="keywords" content="{{Site::get('homekeywords')}}">
    <meta name="description" content="{{Site::get('homedescription')}}">
    @parent
    <link rel="stylesheet" type="text/css" href="{{asset('/default/css/company/welcome.css')}}">
    <link rel="stylesheet" href="{{asset('/default/css/part_time/manage.css')}}">
@endsection

{{--主体内容--}}
@section('content')
    {{--职位信息及侧边下载框--}}
    <div class="main">
        <div class="wrapper">
            <div class="asideNav">
                <ul>
                    @include('default.layouts.part_time_public_left')
                </ul>
            </div>
            {{--报名管理--}}
            <div class="manage">
                <ul class="switchNav">
                    <li class="@if($filter['status']==0){!! 'active' !!}@endif" data-value="0">待处理的报名者</li>
                    <li class="@if($filter['status']==1){!! 'active' !!}@endif" data-value="1">已录用的报名者</li>
                    <li class="@if($filter['status']==2){!! 'active' !!}@endif" data-value="2">不合适的报名者</li>
                </ul>
                {{--待处理--}}
                <div class="pending">
                    <div class="title">
                        <span class="name">姓名</span>
                        <span class="gender">性别</span>
                        <span class="school">学校</span>
                        <span class="workPlace">期望地点</span>
                        <span class="intention">求职意向</span>
                    </div>
                    <form class="resumes" action="" method="post" name="thisForm">
                        <dl>
                            {!! csrf_field() !!}
                            <dt>共收到<span>{{$list->total()}}</span>份简历</dt>
                            @if($list->count() == 0)
                                {{--空样式--}}
                                <dd class="noJob">
                                    <img src="{{ asset("/default/images/index/bgpic.jpg") }}">
                                    <p>对不起，暂时没有符合条件的记录!</p>
                                </dd>
                            @else
                                @foreach($list as $k => $v)
                                    <dd>
                                        <span class="name">
                                            <input name="selected_id[]" class="checkbox" value="{{$v->id}}"
                                                   type="checkbox"/>
                                            <a class="tipTitleName" href="{{url('company/pt_resume')}}_{{$v->id}}.html"
                                               target="_blank">{{$v->signUpResume->name}}</a>
                                        </span>
                                        <span class="gender">{{$v->signUpResume->sexName}}</span>
                                        <span class="school">{{str_limit($v->signUpResume->school,28)}}</span>
                                        <span class="workPlace">{{str_limit($v->signUpResume->place_city,28)}}</span>
                                        <span class="intention">{{str_limit($v->signUpResume->intention_name,28)}}</span>
                                    </dd>
                                @endforeach
                                <dd class="action">
                                    <input name="selectAll" id="selectAll" class="checkbox" type="checkbox"
                                           onclick="checkAll(this)"/><label for="selectAll">全选</label>
                                    @if($filter['status']==0)
                                        <button type="button" class="employ"
                                                onclick="showConfirm('{{url('company/pt_sign_status')}}?status=1','employ')">
                                            录用
                                        </button>
                                        <button type="button" class="declined"
                                                onclick="showConfirm('{{url('company/pt_sign_status')}}?status=2','declined')">
                                            婉拒
                                        </button>
                                    @endif
                                    <button type="button" class="delete"
                                            onclick="showConfirm('{{url('company/pt_sign_status')}}?status=3','delete')">
                                        删除
                                    </button>
                                </dd>
                            @endif
                        </dl>
                        {{--分页--}}
                        <div class="page_list">
                            {!! $list->links() !!}
                        </div>
                    </form>
                </div>
            </div>
        </div>
    </div>
    {{--职位信息及侧边下载框结束--}}
@endsection
{{--兼职详情页js--}}
@section('footerjs')
    @parent
    <script type="text/javascript" src="{{asset('/default/js/part_time/pt_sign_up.js')}}"></script>
    <script>
        $(function () {
            //消息检测
            layer.ready(function(){
                if ('{{ Session::has('msg')}}') {
                    layer.msg('{{ Session::get('msg')}}');
                }
            });
            //侧边导航栏点击事件
            $('.main .wrapper .asideNav ul').on('click.asideNav', 'li', function () {
                var url = $(this).attr('data-href');
                window.location.href = url;
            });
            //右侧顶部导航栏点击事件
            $('.main .manage .switchNav').on('click.switchNav', 'li', function () {
                var status = $(this).attr('data-value');
                window.location.href = "{{url('company/pt_sign_up')}}" + '?status=' + status;
            });
            //点击查看职位详情Tip弹窗
            $('.tipTitleName').mouseover(function(){
                var TextTip = layer.tips('点击查看简历详情', this, {tips: 3});
                $(this).mouseout(function(){
                    layer.close(TextTip);
                });
            });
        });
    </script>
@endsection